import { getUserPlayList } from '@/api/user.js'
import { logout } from '@/api/login.js'
export default {
  // 这个没返回东西,因为没有携带cookie
  // async getUserAccount () {
  //   const res = await getAccount()
  // }
  // 获取歌单,包括自己创建的和收藏的
  async getPlayList (context, uid) {
    const res = await getUserPlayList(uid)
    context.commit('savePlayList', res.data.playlist)
  },
  // 退出登录
  async doLogout (context) {
    const res = await logout()
    console.log(res)
    context.commit('saveUserInfo', { account: {}, profile: {}, cookie: '' })
    context.commit('setIsLogin', false)
  }
}
